import request from '@/utils/request';

// 前台商品
export function getProductLists(data) {
    return request({
        url: '/product/list',
        method: 'get',
        params: data,
    });
}

// 购物车列表
export function getCartList() {
    return request({
        url: '/cart/list',
        method: 'get',
    });
}

// 添加商品到购物车
export function postCartAdd(data) {
    return request({
        url: '/cart/add',
        method: 'post',
        params: data,
    });
}

// 更新购物车某个商品的数量
export function updateCartNumber(data) {
    return request({
        url: '/cart/update',
        method: 'post',
        params: data,
    });
}

// 删除购物车的某个商品
export function deleteCartGoods(data) {
    return request({
        url: '/cart/delete',
        method: 'post',
        params: data,
    });
}

// 选中/不选中购物车的某个商品
export function changeGoodsSelect(data) {
    return request({
        url: '/cart/select',
        method: 'post',
        params: data,
    });
}

// 全选/全不选购物车的某个商品
export function changeGoodsSelectAll(data) {
    return request({
        url: '/cart/selectAll',
        method: 'post',
        params: data,
    });
}
